const defaultData = {
    style: 1
};

Component({
    /**
   * 组件的属性列表
   */
    options: {
        addGlobalClass: true
    },
    properties: {
        goodsListStyle: {
            type: Object,
            observer(newVal, oldVal, changePath) {
                const comStyle = this.data.comStyle;
                this.setData({
                    comStyle: {
                        ...comStyle,
                        ...newVal
                    }
                });
            }
        },
        goodsListData: {
            type: Object,
            observer(newVal, oldVal, changePath) {
                this.setData({
                    listData: newVal
                });
            }
        },
        refundData: {
            type: Object,
            observer(newVal, oldVal, changePath) {
                this.setData({
                    refund: newVal
                });
            }
        },
        proMoney: {
            type: Object,
            observer(newVal, oldVal, changePath) {
                this.setData({
                    promoney: newVal
                });
            }
        },
        refundProPrice: {
            type: Object,
            observer(newVal, oldVal, changePath) {
                this.setData({
                    refundAll: newVal
                });
            }
        },
        url: {
            type: String,
            observer(newVal, oldVal, changePath) {
                this.setData({
                    comUrl: newVal
                });
            }
        },
        features: {
            type: Object,
            observer(newVal, oldVal, changePath) {
                this.setData({
                    features: newVal
                });
            }
        },
        vipStatus: {
            type: Number,
            observer(newVal, oldVal, changePath) {
                this.setData({
                    vipStatus: newVal
                });
            }
        }
    },
    /**
   * 组件的初始数据
   */
    data: {
        comStyle: {
            ...defaultData
        }
    },
    /**
   * 组件的方法列表
   */
    methods: {
        cancelModal() {
            this.setData({
                isHidden: true
            });
            const myEventDetail = {
                goodsIsHidden: true
            };
            const myEventOptions = {};
            this.triggerEvent("myevent", myEventDetail, myEventOptions);
        },
        goTo(e) {
            wx.navigateTo({
                url: e.currentTarget.dataset.url
            });
        }
    }
});